﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SQuestioninfo.cs" company="hoandd   ">
// hoandd
// </copyright>
// <summary>
//   Summary description for SurveyQuestionController
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DesktopModules.Surveys
{
    using System.Collections.Generic;
    using DotNetNuke.Common.Utilities;

    /// <summary>
    /// Summary description for SurveyQuestionController
    /// </summary>
    public class SurveyQuestionController
    {
        public SurveyQuestionController()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        #region Public Methods

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// adds an object to the database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="obj">The SurveyQuestionInfo object</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------

        public static void AddSurveyQuestion(SurveyQuestionInfo obj)
        {
            DataProvider.Instance().AddSurveyQuestion(obj.SurveyID, obj.SQuestionID);
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// deletes an object from the database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="">The SurveyQuestionID of the SurveyQuestion</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public static void DeleteSurveyQuestion(int SurveyQuestionID)
        {
            DataProvider.Instance().DeleteSurveyQuestion(SurveyQuestionID);
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// gets an object from the database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="">TheSurveyQuestionID of SurveyQuestion</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public static SurveyQuestionInfo GetSurveyQuestion(int SurveyQuestionID)
        {
            return CBO.FillObject<SurveyQuestionInfo>(DataProvider.Instance().GetSurveyQuestion(SurveyQuestionID));
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// gets an object from the database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public static List<SurveyQuestionInfo> GetSurveyQuestions()
        {
            return CBO.FillCollection<SurveyQuestionInfo>(DataProvider.Instance().GetSurveyQuestions());
        }

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// saves an object to the database
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="obj">The SurveyQuestionInfo object</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public static void UpdateSurveyQuestion(SurveyQuestionInfo obj)
        {
            DataProvider.Instance().UpdateSurveyQuestion(obj.SurveyQuestionID, obj.SurveyID, obj.SQuestionID);
        }

        #endregion Public Methods
    }
}